package com.ipartek.pruebas.bbddaccessP5;

import java.io.FileReader;
import java.io.IOException;

public class TXTDAOFactoryP5 extends DAOFactoryP5{

	static final String FILE_NAME  = "Alumnos.txt";
	static final String CON_URL    = "data";
	
	public TXTDAOFactoryP5(){
		
	}
	
	public static FileReader getConnection(){
		FileReader fl = null;
		try{
			
			return new FileReader(CON_URL+"/"+FILE_NAME);
			
		}catch(IOException e){
			System.out.println("Error abriendo el fichero " + CON_URL+"/"+FILE_NAME);
		}
		return fl;
	}
	
	@Override
	public AlumnoDAOP5 getAlumno() {
		return new AlumnoTXTDAOP5();
	}

	@Override
	public CursoDAOP5 getCurso() {
		return new CursoTXTDAOP5();
	}

}
